#include "pvd.h"
#include "stmflash.h"
extern uint16_t num[2];
void PVD_Config(void)
{
	__HAL_RCC_PWR_CLK_ENABLE();
	
    HAL_NVIC_SetPriority(PVD_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(PVD_IRQn);
	
    PWR_PVDTypeDef sConfigPVD;
    sConfigPVD.PVDLevel = PWR_PVDLEVEL_7;
    sConfigPVD.Mode = PWR_PVD_MODE_IT_RISING;
    HAL_PWR_ConfigPVD(&sConfigPVD);

    HAL_PWR_EnablePVD();
	
}
void HAL_PWR_PVDCallback(void)
{
	STMFLASH_Write(FLASH_SAVE_ADDR,num,2);
	HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_RESET);
}
